#include<stdio.h>
#include<stdlib.h>
#include<string.h> 

/*
char *f() 
{
     char *p;
     p = (char *)malloc(100);
     return p; 
}

int main()
{
    char *str=NULL;        
    str = f();
    strcpy(str,"hello world");
    printf("%s\n",str);
    system("pause");
    return 0;
}
*/

void f(char *p) 
{
    p = (char*)malloc(100)     ;
}

int main()
{
    char* str=NULL;        
    f(str);

    strcpy(str,"hello world");
    printf("%s\n",str);
    system("pause");
    return 0;    
}
